package homework.demo4.controller;

import homework.demo4.mapper.IUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Scanner;
@Component
public class UserController {
    @Autowired
    private IUserMapper userMapper;
    public void start(){
        System.out.println("开始工作");
        System.out.println("请选择对应的操作");
        System.out.println("1.注册,2登录，3，再说");
        System.out.println("请输入对应的数字");
        Scanner sc = new Scanner(System.in);
        int num  = Integer.parseInt(sc.nextLine());
        switch (num){
            case 1:
                this.loginUser();
                break;
            case 2:
                  this.regUser();
                    break;
            case 3:
                    System.out.println("再会，没事别烦我");
                    break;
            default:
                    System.out.println("其他功能还在完善，404");

        }
    }
    public void loginUser(){

        System.out.println("开始处理用户登录");
        userMapper.insert(null);
    }
    public void regUser(){

        System.out.println("开始处理用户注册");
    }
}
